//------- Object.creat()

var Animal=function(){
    this.address='earth'
    this.sound=function(){
        console.log('hohoho');
    }
}
var animal = new Animal()
//实现
function myObject(obj){
    let F = function(){}
    F.prototype=obj
    return new F()
}
//测试
cloneAnimal=myObject(animal)
console.log(cloneAnimal.address);//earth
animal.address='moon'
console.log(cloneAnimal.address);//moon


let cc=Object.create(null)
let bb={
    x:1
}
console.log(Object.getPrototypeOf(cc)===Object.prototype);
cc.__proto__=bb
console.log(Object.getPrototypeOf(cc));


/*
function f(){
    let a=[],
        b=[]
    a.push(...arguments);
    // [].push.apply(b,arguments)
    console.log(a);
}
f(1,2,3,4,5)
*/

console.log(a);//undefined
var a={
    b:1
}
